/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package gui.event.benhan;

import control.benhan.BASuaThongTin_Full_Ctrl;
import gui.benhan.BASuaThongTin_Dialog;
import gui.event.ulti.Util;
import java.util.List;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JOptionPane;
import javax.swing.JTable;
import model.dao.benhan.BenhAnDAO;
import model.entity.BenhAn;

/**
 *
 * @author Admin
 */
public class BASuaThongTinFull_evt {
    
    public static final void btnLietKeActionPerformed(){
//        JOptionPane.showMessageDialog(null, "Can't access DB");
    }
    
    public static final void btnSuaActionPerformed(JTable table){
        BenhAn benhAn = BASuaThongTin_Full_Ctrl.selectRow(table);
        BASuaThongTin_Dialog baSuaDlg = new BASuaThongTin_Dialog(table, null, true);
        
        baSuaDlg.getTxtMaHoSo().setText(""+benhAn.getBaMa());
        baSuaDlg.getTxtMaVatNuoi().setText(benhAn.getVatNuoi().getVnMa() + "");
        baSuaDlg.getTxtMaBenh().setText(benhAn.getBenh().getBenhAns() + "");
        baSuaDlg.getjDateChooserNgayBatDau().setDate(benhAn.getBaNgayBd());
        baSuaDlg.getjDateChooserNgayKetThuc().setDate(benhAn.getBaNgayKt());
        if(benhAn.getBaTrangThai().equalsIgnoreCase("Còn bệnh"))
            baSuaDlg.getRbtnConBenh().setSelected(true);
        else
            baSuaDlg.getRbtnHetBenh().setSelected(true);
        baSuaDlg.getTaGhiChu().setText(""+benhAn.getBaGhiChu());
        
        baSuaDlg.setLocationRelativeTo(null);
        baSuaDlg.setVisible(true);
    }
    
    public static final void btnCloseActionPerformed(JDialog dlg){
        dlg.dispose();
    }
    
//    public static final void btlHSBAFocusGained(List<JButton>listButtons, JTable table){
//        Util.enableListButtons(listButtons);
//        
//    }
    
    
            
}
